package com.jia.lidao.network.http.request.impl;

import com.jia.lidao.Constans;
import com.jia.lidao.network.http.request.AbstractRequest;

import org.apache.http.Header;

import java.lang.reflect.Type;
import java.util.List;

/**
 * Created by jia on 17/12/23.
 */

public class DealWithLoanRequest extends AbstractRequest{

    private int id;

    private int status;

    private String reason;

    public DealWithLoanRequest(int id, int status, String reason){
        this.id=id;
        this.status=status;
        this.reason=reason;
    }

    @Override
    public String getUrl() {
        return Constans.BASEURL+"/loans/"+id+"/merchants/audit";
    }

    @Override
    public void initRequestParams() {
        addParam("loan_id",String.valueOf(id));
        addParam("status",String.valueOf(status));
        if(status==-1){
            addParam("reason",reason);
        }
    }

    @Override
    public List<Header> getHeaders() {
        return null;
    }

    @Override
    public Type getResultType() {
        return Void.class;
    }
}
